Classes

ControlParameter

Stores control settings.

Type Member Name Description Default Value
Double Timeout Timeout period (1 to 9999 seconds) 5
Double Wait Wait before transmission (0 to 9999 seconds) 0
Int32 RepeatNum Number of repetitions (0 to 9999 times) 1

OptionParameter

Stores option settings.

Type Member Name Description Default Value
Boolean SendCheck Check before sending (true:Confirm, false:Don’t confirm) false
Boolean NotOverWriteMsg No overwrite message (true:Don’t show, false:Show) false
Boolean NotEndMsg No end message (true:Don’t show, false:Show) false
Boolean TimeLog Output time stamp (true:Output, false:Don’t output) false
Boolean CommTimeLog Output communication time (true:Output, false:Don’t output) false
Boolean OverWrite Overwrite with repeat (true:Output, false:Don’t output) false
Boolean SeparateComma Split by COMMA and SEMICOLON (true:Split, false:Don’t split) false
String ExponentFormat Exponential display format "###.0#########E+00"
String LineAccessToken LINE access token ""

InterfaceParameter

Stores interface settings.

Type Member Name Description Default Value
Int32 InterfaceType Interface (0:Not used, 1:RS-232C/USB, 2:LAN, 3:GPIB(NI), 4:GPIB(CONTEC), 5:VISA) 0
Int32 Terminator Transmit terminator (0:None, 1:CR+LF, 2:CR, 3:LF) 1
Int32 Charset Charset (0:ASCII, 1:UTF-8, 2:Shift-JIS) 0
String RsComPort RS-232C/USB COM Port ""
Int32 RsSpeed RS-232C/USB Speed (4800, 9600, 14400, 19200, 38400, 57600, 115200) 9600
Int32 RsData RS-232C/USB Data (0:7bit, 1:8bit) 1
Int32 RsParity RS-232C/USB Parity (0:None, 1:Odd, 2:Even) 0
Int32 RsStopBits RS-232C/USB Stop bits (0:1bit, 1:2bit) 0
Boolean RsFlowXon RS-232C/USB Flow control Xon/Xoff (true:On, false:Off) false
Boolean RsFlowRts RS-232C/USB Flow control RTS/CTS (true:On, false:Off) true
Boolean RsFlowDsr RS-232C/USB Flow control DSR/DTR (true:On, false:Off) true
String LanIp LAN IP address "192.168.1.1"
Int32 LanPort LAN Port 6866
Int32 GpibNiBoardId GPIB(NI) Board ID (0 to 99) 0
Int32 GpibNiAddress GPIB(NI) Address (0 to 30) 1
Boolean GpibNiDcl GPIB(NI) Device clear when connected (true:Clear, false:Don’t clear) true
Boolean GpibNiEoi GPIB(NI) Use EOI (true:Use, false:Don’t use) true
Int32 GpibContecBoardId GPIB(CONTEC) Driver No. (1 to 4) 1
Int32 GpibContecAddress GPIB(CONTEC) Address (0 to 30) 1
Boolean GpibContecDcl GPIB(CONTEC) Device clear when connected (true:Clear, false:Don’t clear) true
Boolean GpibContecEoi GPIB(CONTEC) Use EOI (true:Use, false:Don’t use) true
String VisaAddress VISA Address ""
Boolean VisaEom VISA Use EOM (true:Use, false:Don’t use) false

SequenceMakerParameter

Stores all settings for Sequence Maker.

Type Member Name Description
ControlParameter ControlParameter Control settings
OptionParameter OptionParameter Option settings
InterfaceParameter[6] InterfaceParameter Interface settings

Remarks

It is not possible to access the InterfaceParameter array directly from VBA.
Accessed via a reference obtained with the SequenceMakerParameter.GetInterfaceParameter() method.
The argument of the method is an array index (0 to 5).

BinaryData

Stores binary messages.

Type Member Name Description Default Value
Byte[] Data Data null
Int32 Length Data Length 0

Methods

Start

Start sending/receiving.

Syntax

Int32 Start();

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim result As Long

    result = automationObject.Start()
    If result <> 0 Then
        Exit Sub
    End If

Remarks

This is the same function as clicking the Send Command button on the Sequence Maker ribbon.
It does not return from the method until the send/receive is complete.

Stop

Stop sending/receiving.

Int32 Stop();

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim result As Long

    result = automationObject.Stop()
    If result <> 0 Then
        Exit Sub
    End If

Remarks

This is the same function as clicking the Stop button on the Sequence Maker ribbon.
The Start() method does not return from the method until the send/receive is complete, so it is used when the send/receive is started with the Send Command button on the ribbon.

GetStatus

Returns send/receive status.

Syntax

Int32 GetStatus();

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim result As Long

    result = automationObject.GetStatus()

GetControlSetting

Get control settings.

Syntax

Int32 GetControlSetting(ref ControlParameter controlSetting);

Parameter

controlSetting

Control settings

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim controlSetting As Variant
    Set controlSetting = automationObject.CreateControlParameter()
    Dim result As Long

    result = automationObject.GetControlSetting(controlSetting)
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateControlParameter() method in the control settings argument.

SetControlSetting

Set control settings.

Syntax

Int32 SetControlSetting(ControlParameter controlSetting);

Parameter

controlSetting

Control settings

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim controlSetting As Variant
    Set controlSetting = automationObject.CreateControlParameter()
    Dim result As Long

    controlSetting.Timeout = 5#
    result = automationObject.SetControlSetting(controlSetting)
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateControlParameter() method in the control settings argument.

GetOptionSetting

Get option settings.

Syntax

Int32 GetOptionSetting(ref OptionParameter optionSetting);

Parameter

optionSetting

Option settings

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim optionSetting As Variant
    Set optionSetting = automationObject.CreateOptionParameter()
    Dim result As Long

    result = automationObject.GetOptionSetting(optionSetting)
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateOptionParameter() method in the option settings argument.

SetOptionSetting

Set option settings.

Syntax

Int32 SetOptionSetting(OptionParameter optionSetting);

Parameter

optionSetting

Option settings

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim optionSetting As Variant
    Set optionSetting = automationObject.CreateOptionParameter()
    Dim result As Long

    optionSetting.SendCheck = False
    result = automationObject.SetOptionSetting(optionSetting)
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateOptionParameter() method in the option settings argument.

GetInterfaceSetting

Get interface settings.

Syntax

Int32 GetInterfaceSetting(ref InterfaceParameter interfaceSetting, Int32 interfaceNo);

Parameter

interfaceSetting

Interface settings

interfaceNo

Interface No. (1 to 6)

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim interfaceSetting As Variant
    Set interfaceSetting = automationObject.CreateInterfaceParameter()
    Dim result As Long

    result = automationObject.GetInterfaceSetting(interfaceSetting, 1)
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateInterfaceParameter() method in the interface settings argument.

SetInterfaceSetting

Set interface settings.

Syntax

Int32 SetInterfaceSetting(InterfaceParameter interfaceSetting, Int32 interfaceNo);

Parameter

interfaceSetting

Interface settings

interfaceNo

Interface No. (1 to 6)

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim interfaceSetting As Variant
    Set interfaceSetting = automationObject.CreateInterfaceParameter()
    Dim result As Long

    interfaceSetting.InterfaceType = 1
    result = automationObject.SetInterfaceSetting(interfaceSetting, 1)
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateInterfaceParameter() method in the interface settings argument.

GetSequenceMakerSetting

Get Sequence Maker settings.

Syntax

Int32 GetSequenceMakerSetting(ref SequenceMakerParameter sequenceMakerSetting);

Parameter

sequenceMakerSetting

Sequence Maker settings

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim sequenceMakerSetting As Variant
    Set sequenceMakerSetting = automationObject.CreateSequenceMakerParameter()
    Dim result As Long

    result = automationObject.GetSequenceMakerSetting(sequenceMakerSetting)
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateSequenceMakerParameter() method in the Sequence Maker settings argument.

SetSequenceMakerSetting

Set Sequence Maker settings.

Syntax

Int32 SetSequenceMakerSetting(SequenceMakerParameter sequenceMakerSetting);

Parameter

sequenceMakerSetting

Sequence Maker settings

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim sequenceMakerSetting As Variant
    Set sequenceMakerSetting = automationObject.CreateSequenceMakerParameter()
    Dim interfaceSetting As Variant
    Dim result As Long

    sequenceMakerSetting.ControlParameter.Timeout = 5#
    sequenceMakerSetting.OptionParameter.SendCheck = False
    Set interfaceSetting = sequenceMakerSetting.GetInterfaceParameter(0)
    interfaceSetting.InterfaceType = 1
    result = automationObject.SetSequenceMakerSetting(sequenceMakerSetting)
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateSequenceMakerParameter() method in the Sequence Maker settings argument.

ReadSequenceMakerSetting

Reading Sequence Maker settings from a file.

Syntax

Int32 ReadSequenceMakerSetting(ref SequenceMakerParameter sequenceMakerSetting,
    String pathname);

Parameter

sequenceMakerSetting

Sequence Maker settings

pathname

Settings file name

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim sequenceMakerSetting As Variant
    Set sequenceMakerSetting = automationObject.CreateSequenceMakerParameter()
    Dim result As Long

    result = automationObject.ReadSequenceMakerSetting(sequenceMakerSetting, "SequenceMaker.xml")
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateSequenceMakerParameter() method in the Sequence Maker settings argument.

WriteSequenceMakerSetting

Write Sequence Maker settings to a file.

Syntax

Int32 WriteSequenceMakerSetting(SequenceMakerParameter sequenceMakerSetting,
    String pathname);

Parameter

sequenceMakerSetting

Sequence Maker settings

pathname

Settings file name

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim sequenceMakerSetting As Variant
    Set sequenceMakerSetting = automationObject.CreateSequenceMakerParameter()
    Dim result As Long

    result = automationObject.WriteSequenceMakerSetting(sequenceMakerSetting, "SequenceMaker.xml")
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created by the CreateSequenceMakerParameter() method in the Sequence Maker settings argument.

CreateControlParameter

Create an instance of ControlParameter.

Syntax

ControlParameter CreateControlParameter();

Return Value

ControlParameter

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim controlSetting As Variant
    Set controlSetting = automationObject.CreateControlParameter()

CreateOptionParameter

Create an instance of OptionParameter.

Syntax

OptionParameter CreateOptionParameter();

Return Value

OptionParameter

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim optionSetting As Variant
    Set optionSetting = automationObject.CreateOptionParameter()

CreateInterfaceParameter

Create an instance of ControlParameter.

Syntax

InterfaceParameter CreateInterfaceParameter();

Return Value

InterfaceParameter

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim interfaceSetting As Variant
    Set interfaceSetting = automationObject.CreateInterfaceParameter()

CreateSequenceMakerParameter

Create an instance of SequenceMakerParameter.

Syntax

SequenceMakerParameter CreateSequenceMakerParameter();

Return Value

SequenceMakerParameter

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim sequenceMakerSetting As Variant
    Set sequenceMakerSetting = automationObject.CreateSequenceMakerParameter()

CreateBinaryData

Create an instance of BinaryData.

Syntax

BinaryData CreateBinaryData();

Return Value

BinaryData

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim binaryData As Variant
    Set binaryData = automationObject.CreateBinaryData()

InterfaceOpen

Open interface.

Syntax

Int32 InterfaceOpen(Int32 interfaceNo);

Parameter

interfaceNo

Interface No. (1 to 6)

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim result As Long

    result = automationObject.InterfaceClose(1)
    If result <> 0 Then
        Exit Sub
    End If

InterfaceClose

Close interface.

Syntax

Int32 InterfaceClose(Int32 interfaceNo);

Parameter

interfaceNo

Interface No. (1 to 6)

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim result As Long

    result = automationObject.InterfaceOpen(1)
    If result <> 0 Then
        Exit Sub
    End If

    result = automationObject.InterfaceClose(1)
    If result <> 0 Then
        Exit Sub
    End If

SendMessage

Send message.

Syntax

Int32 SendMessage(Int32 interfaceNo, String sendMessage);

Parameter

interfaceNo

Interface No. (1 to 6)

sendMessage

Message to send

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim result As Long

    result = automationObject.InterfaceOpen(1)
    If result <> 0 Then
        Exit Sub
    End If

    result = automationObject.SendMessage(1, "*TRG")
    If result <> 0 Then
        Call automationObject.InterfaceClose(1)
        Exit Sub
    End If

    result = automationObject.InterfaceClose(1)
    If result <> 0 Then
        Exit Sub
    End If

ReceiveMessage

Receive message.

Syntax

Int32 ReceiveMessage(Int32 interfaceNo, ref String receiveMessage, Double timeout);

Parameter

interfaceNo

Interface No. (1 to 6)

receiveMessage

Received message

timeout

Timeout period (1 to 9999 seconds)

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim receiveMessage As String
    Dim result As Long

    result = automationObject.InterfaceOpen(1)
    If result <> 0 Then
        Exit Sub
    End If

    result = automationObject.ReceiveMessage(1, receiveMessage, 5#)
    If result <> 0 Then
        Call automationObject.InterfaceClose(1)
        Exit Sub
    End If

    result = automationObject.InterfaceClose(1)
    If result <> 0 Then
        Exit Sub
    End If

SendReceiveMessage

Send and receive message.

Syntax

Int32 SendReceiveMessage(Int32 interfaceNo, String sendMessage,
    ref String receiveMessage, Double timeout);

Parameter

interfaceNo

Interface No. (1 to 6)

sendMessage

Message to send

receiveMessage

Received message

timeout

Timeout period (1 to 9999 seconds)

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim receiveMessage As String
    Dim result As Long

    result = automationObject.InterfaceOpen(1)
    If result <> 0 Then
        Exit Sub
    End If

    result = automationObject.SendReceiveMessage(1, ":MEASure?", receiveMessage, 5#)
    If result <> 0 Then
        Call automationObject.InterfaceClose(1)
        Exit Sub
    End If

    result = automationObject.InterfaceClose(1)
    If result <> 0 Then
        Exit Sub
    End If

SendReceiveIeeeBinary

Send and receive binary response message.

Syntax

Int32 SendReceiveIeeeBinary(Int32 interfaceNo, String sendMessage,
    ref BinaryData receiveMessage, Double timeout);

Parameter

interfaceNo

Interface No. (1 to 6)

sendMessage

Message to send

receiveMessage

Received message

timeout

Timeout period (1 to 9999 seconds)

Return Value

Result Code

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim receiveMessage As Variant
    Set receiveMessage = automationObject.CreateBinaryData()
    Dim result As Long

    result = automationObject.InterfaceOpen(1)
    If result <> 0 Then
        Exit Sub
    End If

    result = automationObject.SendReceiveIeeeBinary(1, ":HCOPy:DATA? COLor", receiveMessage, 10#)
    If result <> 0 Then
        Call automationObject.InterfaceClose(1)
        Exit Sub
    End If

    result = automationObject.InterfaceClose(1)
    If result <> 0 Then
        Exit Sub
    End If

Remarks

Specify the instance created with the CreateBinaryData() method for the receive message argument.

GetComPortName

Get COM Port names.

Syntax

String[] GetComPortName();

Return Value

COM Port names

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim comPortName() As String
    comPortName = automationObject.GetComPortName()

GetVisaAddress

Get VISA Addresses.

Syntax

String[] GetVisaAddress();

Return Value

VISA Addresses

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim visaAddress() As String
    visaAddress = automationObject.GetVisaAddress()

GetVersion

Get Sequence Maker version number.

Syntax

String GetVersion();

Return Value

Version number

Example

    Dim automationObject As Object
    Set automationObject = Application.COMAddIns("Sequence Maker").Object
    Dim version As String
    version = automationObject.GetVersion()

Appendix

Result Code

Value Description
0 Success.
1 Sending/Receiving.
2 Stopped.
3 Argument type is wrong.
4 Interface No. is out of range.
5 Interface is opened.
6 Interface is closed.
7 Driver is not installed.
8 Driver version is out of date.
9 Interface not selected.
10 Interface open failed.
11 Timeout period is out of range.
12 Send/Receive failure.
13 File does not exist.
14 File access failure.

How to get Sequence Maker COM add-in object

Add-in name

Sequence Maker

Procedure

    Dim addIn As COMAddIn
    Dim automationObject As Object
    Set addIn = Application.COMAddIns("Sequence Maker")
    Set automationObject = addIn.Object